<template>
  <!-- 展示店铺的所有评论 -->
  <div>
    <div class="item1" v-for="(item, index) in list" :key="index">
      <div>
        <van-cell-group inset>
          <van-cell title="评论人" :value="item.user_name" />
          <van-cell title="评论内容" :value="item.content" />
          <van-cell title="店家" :value="item.shops_name" />
        </van-cell-group>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      list: [],
      id: this.$route.query.id,
      user_id: localStorage.getItem("id"),
      active: 0,
    };
  },
  mounted() {},
  methods: {
    // 获取所有的商品分类
    submit: function () {
      this.myaxios(this.weburl + "user/comment/" + this.id, "get").then(
        (data) => {
          console.log(data);
          if (data.code == 200) {
            this.list = data.data;
            this.$toast.success(data.msg);
          } else {
            this.$toast.fail(data.msg);
          }
        }
      );
    },
  },
  created() {
    this.submit();
  },
};
</script>

<style scoped>
</style>